package fuxi;

public class MyStringTest {
    public static void main(String[] args) {

        String s1 = "hello java";
        String s2 = "hello java";


        if (s1.equals(s2)) {
            System.out.println("两个字符串相等。");

            String noSpaceStr = s1.replaceAll("\\s+", "");

            String replacedStr = noSpaceStr.replace("java", "word");

            System.out.println("处理后的字符串为: " + replacedStr);
        } else {
            System.out.println("两个字符串不相等");
        }
    }
}
